cishu = 0
def move(n,a,b,c):
    global cishu
    if n == 1:
        print(a,'-->',c)
        cishu += 1
    else:
        move(n-1,a,c,b)
        print(a,'-->',c)
        cishu += 1
        move(n-1,b,a,c)
    return (cishu)
move(3,'A','B','C')
print(cishu)